/*******************************************************************************
 * Copyright 2009 DCSpectrometer - http://code.google.com/p/dcspectrometer 
 *  
 * Licensed under the Apache License, Version 2.0 (the "License"); 
 * you may not use this file except in compliance with the License. 
 * You may obtain a copy of the License at 
 *  
 *     http://www.apache.org/licenses/LICENSE-2.0 
 *     
 * Unless required by applicable law or agreed to in writing, software 
 * distributed under the License is distributed on an "AS IS" BASIS, 
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
 * See the License for the specific language governing permissions and 
 * limitations under the License. 
 *******************************************************************************/
package com.dcspectrometer.Analysis;

/**
 * This class defines the basic services that a statistics object should provide.
 * StatCalculator can be used to calculate the statistic of x(1),...,x(N) on the fly. Every time
 * we add a variable, and the value updates itself.
 */
public interface IStatCalculator {

	/**
	 * @param value The new value of the sequence.
	 */
	public void addValue(double value);
	
	/**
	 * @return The result of the calculation thus far.
	 */
	public double getResults();
	
	/**
	 * @return The name of the calculator, e.g. Mean
	 */
	public String getName();
	
	/**
	 * @return A new calculator. Might be used as a factory.
	 */
	public IStatCalculator getNew();
}
